package br.com.gfkauer.model.facade;

import br.com.gfkauer.model.dao.UserDAO;
import br.com.gfkauer.model.entity.User;

public class UserFacade {

	private UserDAO userDAO = new UserDAO();
	
	public User isValidLogin(String email, String password){
		userDAO.beginTransactio();
		User user = userDAO.findUserByEmail(email);
		
		if(user ==null || !user.getPassword().equals(password)){
			return null;
		}
		
		return user;
	}
}
